package divideYvenceras;

public class Exponente {
	
	public static int exp(int pow, int num) throws Exception{
		if (pow<0) throw new Exception ("no puede calcular exponentes negativos");
	    if (pow == 0) 
	        return 1; 
	    else
	        return num * exp(pow-1, num) ;
	}

	public static void main (String [] args) {    
		try{
			System.out.println (exp (10, 5));
		}catch (Exception e) {System.out.println(e.toString());}
	}

}
